
import { ZYNet } from "./HXJNet";

/**
 * 服务器接口
 * @author: xj.huang
 * @date: 2021/08/12 11:37:56
 */
class _ZYNetMgr {
    //正式服API
    public API = 'https://api-test.aligame.top/';   //https://api.aligame.top/';
    //数据API
    public DATA = 'https://data.aligame.top/';
    constructor() {
    }
    private static _instance: _ZYNetMgr;
    public static get instance(): _ZYNetMgr {
        if (!this._instance) {
            this._instance = new _ZYNetMgr();
        }
        return this._instance;
    }
    /**登录 */
    async login(param) {
        let data = await ZYNet.sendAsync(this.API + ZYAPI.LOGIN, param)


        return data;
    }
    /**获取配置 */
    async getConfig(param = {}) {
        return await ZYNet.sendAsync(this.API + ZYAPI.GET_APP_CONFIG, param)
    }
    /**更新用户信息 */
    async updataUseInfo(param) {
        return await ZYNet.sendAsync(this.DATA + ZYAPI.PUSH_USER_DAU, param)
    }
    /**用户信息导出更新 */
    async updateUserExtData(param = {}) {
        return await ZYNet.sendAsync(this.API + ZYAPI.UPDATE_USER_EXT_DATA, param)
    }
    /**用户信息导出更新 */
    async export(param = {}) {

        return await ZYNet.sendAsync(this.DATA + ZYAPI.PUSH_USER_EXPORT, param)
    }
    /**获取用户IP信息 */
    async getLocation(param = {}) {
        return await ZYNet.sendAsync(this.API + ZYAPI.GET_LOCATION, param)
    }
}
export const ZYNetMgr = _ZYNetMgr.instance;